// Copyright (c) Huawei Technologies Co., Ltd. 2025. All rights reserved.
// This source file is part of the Cangjie project, licensed under Apache-2.0
// with Runtime Library Exception.
//
// See https://cangjie-lang.cn/pages/LICENSE for license information.

#ifndef CANGJIE_MIGRATOR_OPTIONS
#define CANGJIE_MIGRATOR_OPTIONS

#include <Interfaces.h>
#include <string>

#include "Path.h"

namespace CangjieMigrator {

using ArgvType = char **;

class Option {
public:
    enum class Mode {
        FILE,
        PROJECT,
        DEVECO,
    };

    bool ParseArgs(int argc, ArgvType argv);

    static void PrintUsage();

    [[nodiscard]] bool IsFileMode() const;
    [[nodiscard]] bool IsProjectMode() const;
    [[nodiscard]] bool IsDevecoMode() const;
    [[nodiscard]] UpdaterMode GetUpdaterMode() const;
    [[nodiscard]] bool IsHelp() const;

    [[nodiscard]] std::string ToString() const;

    Path inputPath{""};
    Path outputPath{""};
    std::string sourceVersion{"earliest"};
    std::string targetVersion{"latest"};

    Mode mode{};
    bool isHelp = false;
};

} // namespace CangjieMigrator

#endif // CANGJIE_MIGRATOR_OPTIONS